#pragma once
#include <iostream>
#include <string>
#include <vector>
#include <unistd.h>

using namespace std;

typedef void(*work_t)();
typedef void(*task_t)(int);

void task1(int code) { cout << "执行任务1" << endl;}
void task2(int code) { cout << "执行任务2" << endl;}
void task3(int code) { cout << "执行任务3" << endl;}

task_t task[3] = {task1, task2, task3};

int getTaskNode()
{
    static int i = 0;
    int tnode = i++;
    i %= 3;
    return tnode;
}

void Work()
{
    printf("I am working, mypid is %d\n", getpid());
}